<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\controller;

/**
 * 综合测评控制器
 */
class Test extends AdminBase
{
    
    /**
     * 活动列表
     */
    public function testList()
    {
        
        $this->assign('test', $this->logicTest->getTestList());
        
        return $this->fetch('test_list');
    }
    
    
    /**
     * 活动信息添加
     */
    public function testAdd()
    {
        
        IS_POST && $this->jump($this->logicTest->testEdit($this->param));
        
        return $this->fetch('test_edit');
    }
    
    /**
     * 活动信息编辑
     */
    public function testEdit()
    {
        
        IS_POST && $this->jump($this->logicTest->testEdit($this->param));
        
        $info = $this->logicTest->getTestInfo(['id' => $this->param['id']]);
        
        $this->assign('info', $info);
        
        return $this->fetch('test_edit');
    }
    
    /**
     * 活动信息删除
     */
    public function testDel($id = 0)
    {
        
        $this->jump($this->logicTest->testDel(['id' => $id]));
    }
}
